<div class="animated" ng-class="{true: 'fadeInRight', false:'fadeInLeft'}[currentAnimated]">
  <div class="row search-area">
    <div class="col-xs-6 col-md-6">
      <div class="btn-group" role="group">
        <a ui-sref=".addProduct" class="btn btn-default" title="新增"><i class="fa fa-plus-square rotate180"></i><span class="hidden-xs">新增</span></a>
        <a ng-click="remove()" class="btn btn-default" title="删除"><i class="fa fa-trash"></i><span class="hidden-xs">删除</span></a>
        <a ng-click="refreshCache()" class="btn btn-default" title="刷新首页缓存"><i class="fa fa-refresh"></i><span class="hidden-xs">刷新首页缓存</span></a>
        <!-- <a ui-sref="products.derivatives" class="btn btn-default" title="衍生品管理"><i class="fa fa-gears"></i><span class="hidden-xs">衍生品管理</span></a> -->
      </div>
    </div>

    <div class="col-xs-6 col-md-6">
      <form class="form-inline pull-right">
        <div class="input-group" >
          <input type="text" class="form-control" name="name" placeholder="商品名称" ng-model="artwork.name">
          <span class="input-group-btn">
            <button class="btn btn-primary" type="button" ng-click="search()"><i class="fa fa-search"></i><span class="hidden-xs hidden-sm">搜索</span></button>
          </span>
        </div>
        <a class="btn btn-default" data-toggle="modal" data-backdrop="static" data-target="#advancedSearch"><i class="fa fa-filter"></i><span class="hidden-xs hidden-sm">高级搜索</span></a>
      </form>
    </div>
  </div>
  
  <div class="row">
    <div class="col-xs-12 col-md-12">
      <div ui-grid="gridOptions" ui-grid-selection ui-grid-pagination ui-grid-resize-columns ui-grid-move-columns class="grid"></div>
    </div>
  </div>
</div>

<div class="modal" id="advancedSearch" tabindex="-1" role="dialog" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
       <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title">高级搜索</h4>
       </div>
       <div class="modal-body">
        <div class="row">
          <form class="form-horizontal searchForm" role="form" name="productForm" >
            <div class="col-xs-6 col-md-6">
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">商品名称：</label>
                <div class="col-xs-12 col-md-9">
                  <input type="text" class="form-control" name="name" placeholder="商品名称" ng-model="artwork.name">
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">商品类型：</label>
                <div class="col-xs-12 col-md-9">
                  <select class="form-control" name="artworkType" ng-model="artwork.artworkType" ng-change="loadCategoryList()">
                    <option value="">----全部类型----</option>
                    <option ng-repeat="item in artwork.typeList" value="{{item.propertyName}}">{{item.value}}</option>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">价格：</label>
                <div class="col-xs-12 col-md-9">
                  <input type="text" class="form-control fl w80" name="minPrice" placeholder="最低价" ng-model="artwork.minPrice">
                  <em class="fl spitter">--</em>
                  <input type="text" class="form-control fl w80" name="maxPrice" placeholder="最高价" ng-model="artwork.maxPrice">
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">上架时间：</label>
                <div class="col-xs-12 col-md-9">
                  <input type="text" class="form-control fl w120" id="beginShelvesTime" name="beginShelvesTime" placeholder="上架起始" idate ng-model="artwork.beginShelvesTime">
                  <em class="fl spitter">--</em>
                  <input type="text" class="form-control fl w120" id="endShelvesTime" name="endShelvesTime" placeholder="上架截止" idate ng-model="artwork.endShelvesTime">
                </div>
              </div>
            </div>
            <div class="col-xs-6 col-md-6">
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">艺术家：</label>
                <div class="col-xs-12 col-md-9">
                  <input type="text" class="form-control" name="artworkAuthor" placeholder="艺术家" ng-model="artwork.artworkAuthor">
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">商品分类：</label>
                <div class="col-xs-12 col-md-9">
                  <select class="form-control" name="artworkCategory" ng-model="artwork.artworkCategory">
                    <option value="">----全部分类----</option>
                    <option ng-repeat="item in artwork.categoryList" value="{{item.propertyName}}">{{item.value}}</option>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">状态：</label>
                <div class="col-xs-12 col-md-9">
                  <select class="form-control" name="states" ng-model="artwork.states">
                    <option value="">----全部----</option>
                    <option ng-repeat="item in artwork.commodityStatesList" value="{{item.id}}">{{item.name}}</option>
                  </select>
                </div>
              </div>
              <div class="form-group">
                <label class="control-label hidden-xs hidden-sm col-md-3">发布时间：</label>
                <div class="col-xs-12 col-md-9">
                  <input type="text" class="form-control fl w120" id="beginCreateTime" name="beginCreateTime" placeholder="发布起始" idate ng-model="artwork.beginCreateTime">
                  <em class="fl spitter">--</em>
                  <input type="text" class="form-control fl w120" id="endCreateTime" name="endCreateTime" placeholder="发布截止" idate ng-model="artwork.endCreateTime">
                </div>
              </div>
            </div>
          </form>
        </div>    
       </div>
       <div class="modal-footer">
          <button type="button" class="btn btn-primary" ng-click="search()" data-dismiss="modal">搜索</button>
          <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
       </div>
    </div>
  </div>
</div>

<script type="text/javascript">
$('#advancedSearch').on('shown.bs.modal', function () {
  $(".modal-backdrop").css({"position": "static"});
}).on('hidden.bs.modal', function(){
  $(".modal-backdrop").css({"position" : "fixed"});
});
</script>